<?php

namespace App\Console;

use App\Console\Commands\BankSubAccountFinanceCmd;
use App\Console\Commands\JinShouFuIncomeSyncCmd;
use App\Console\Commands\JinShouFuSubAccountSyncCmd;
use App\Console\Commands\KeruyunDatasSyncCmd;
use App\Console\Commands\MallGroupKtvSyncDatasCmd;
use App\Console\Commands\MeiTuanBusinessTimePeriodCmd;
use App\Console\Commands\YikaSyncDatasCmd;
use App\Tasks\JinShouFuSubAccountSyncTask;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * Define the application's command schedule.
     */
    protected function schedule(Schedule $schedule): void
    {
        // $schedule->command('inspire')->hourly();

        //同步美团分账
        $schedule->command(MeiTuanBusinessTimePeriodCmd::class)->hourlyAt(1)->runInBackground();

        //同步到账
        $schedule->command(BankSubAccountFinanceCmd::class)->hourlyAt(1)->runInBackground();

        //同步瑜伽收入
        $schedule->command(JinShouFuIncomeSyncCmd::class)->hourlyAt(1)->runInBackground();

        //同步瑜伽分账
        $schedule->command(JinShouFuSubAccountSyncCmd::class)->everyMinute()->runInBackground();

        //客如云同步
        $schedule->command(KeruyunDatasSyncCmd::class)->hourlyAt(1)->runInBackground();

        //KTV
        $schedule->command(MallGroupKtvSyncDatasCmd::class)->hourlyAt(1)->runInBackground();

        $schedule->command(YikaSyncDatasCmd::class)->hourlyAt(1)->runInBackground();


    }

    /**
     * Register the commands for the application.
     */
    protected function commands(): void
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
